package com.meilele.dao.czh;

import com.meilele.entity.czh.FiveRevert;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface FiveRevertMapper {
    @Delete({
        "delete from five_revert",
        "where revert_id = #{revertId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer revertId);

    @Insert({
        "insert into five_revert (revert_id, revert_time, ",
        "revert_name, commentaries_id, ",
        "revert_content,respondent_name)",
        "values (#{revertId,jdbcType=INTEGER}, #{revertTime,jdbcType=TIMESTAMP}, ",
        "#{revertName,jdbcType=VARCHAR}, #{commentariesId,jdbcType=INTEGER}, ",
        "#{revertContent,jdbcType=LONGVARCHAR},#{respondentName,jdbcType=VARCHAR})"
    })
    int insert(FiveRevert record);

    int insertSelective(FiveRevert record);

    @Select({
        "select",
        "revert_id, revert_time, revert_name, commentaries_id, revert_content,respondent_name",
        "from five_revert",
        "where revert_id = #{revertId,jdbcType=INTEGER}"
    })
    @ResultMap("com.meilele.dao.czh.FiveRevertMapper.ResultMapWithBLOBs")
    FiveRevert selectByPrimaryKey(Integer revertId);

    int updateByPrimaryKeySelective(FiveRevert record);

    @Update({
        "update five_revert",
        "set revert_time = #{revertTime,jdbcType=TIMESTAMP},",
          "revert_name = #{revertName,jdbcType=VARCHAR},",
          "commentaries_id = #{commentariesId,jdbcType=INTEGER},",
          "revert_content = #{revertContent,jdbcType=LONGVARCHAR}",
        "where revert_id = #{revertId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(FiveRevert record);

    @Update({
        "update five_revert",
        "set revert_time = #{revertTime,jdbcType=TIMESTAMP},",
          "revert_name = #{revertName,jdbcType=VARCHAR},",
            "respondent_name = #{respondentName,jdbcType=VARCHAR},",
          "commentaries_id = #{commentariesId,jdbcType=INTEGER}",
        "where revert_id = #{revertId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(FiveRevert record);

    @Select({
            "select",
            "revert_id, revert_time, revert_name, commentaries_id, revert_content,respondent_name",
            "from five_revert",
            "where commentaries_id = #{commentariesId,jdbcType=INTEGER}"
    })
    @ResultMap("com.meilele.dao.czh.FiveRevertMapper.ResultMapWithBLOBs")
    List<FiveRevert> selectByPrimaryCId(Integer commentariesId);
}